package com.cc.config;

import org.springframework.context.annotation.*;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 33314
 * @version 1.0
 * @description: TODO
 * @date 2025/6/21 14:13
 */
@Configuration //配置类
@ComponentScan(
//        指定扫描包
        basePackages = "com.cc",
//        指定除了controller类的其他类
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.ANNOTATION, value = Controller.class),
                @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = RestController.class)
        }
)
//加载 数据库连接配置文件
@PropertySource("classpath:database.properties")
//导入 MybatisConfig.class、JdbcConfig.class 文件
@Import({MybatisConfig.class, JdbcConfig.class})
@EnableTransactionManagement //开启事务
public class SpringConfig {

}
